import javax.swing.tree.TreeNode;

public class Test {

    public static void main(String[] args) {
        Tree tree = new Tree();
        Tree.TreeNode root = tree.createTree();

        int ret = tree.getHeight(root);
        System.out.println(ret);
    }

    public static void main4(String[] args) {
        Tree tree = new Tree();
        Tree.TreeNode root = tree.createTree();

        int ret = tree.getHeight(root);
        System.out.println(ret);
    }

    public static void main3(String[] args) {
        Tree tree = new Tree();
        Tree.TreeNode root = tree.createTree();

        System.out.println("求树中 第k层的节点个数");
        int ret = tree.getKLevelNodeCount(root,3);
        int ret2 = tree.getKLevelNodeCount2(root,3);
        System.out.println(ret);
        System.out.println(ret2);

    }

    public static void main2(String[] args) {

        Tree tree = new Tree();
        Tree.TreeNode root = tree.createTree();

        System.out.println("求树中 所有叶子节点个数");
        int ret = tree.getLeafNodeCount(root);
        int ret2 = tree.getLeafNodeCount2(root);
        int ret3 = tree.getLeafNodeCount3(root);

        System.out.println(ret);
        System.out.println(ret2);
        System.out.println(ret3);


    }

    public static void main1(String[] args) {
        Tree tree = new Tree();
        Tree.TreeNode root= tree.createTree();
        Tree.TreeNode root1 = tree.createTree();

        System.out.println("求树的所有结点个数");
        int ret = tree.size(root);
        int ret2 = tree.size2(root);
        System.out.println(ret);

        System.out.println(ret2);

    }
}
